package com.wushi.lenovo.asia5b.app_utils.eye;

import android.support.design.widget.CoordinatorLayout;
import android.view.View;
import android.view.animation.LinearInterpolator;

/**
 * Created by zhangyuncai on 2019/1/28.
 */
public class AnimationHelper {
    // FAB移出屏幕动画（隐藏动画）
    public static void animateOut(View fab) {
        CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
        int bottomMargin = layoutParams.bottomMargin;
        fab.animate().translationY(fab.getHeight() + bottomMargin).setInterpolator(new LinearInterpolator()).start();
    }

    // FAB移入屏幕动画（显示动画）
    public static void animateIn(View fab) {
        fab.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
    }

}
